package com.hhl.test;

import com.alibaba.fastjson.JSONObject;
import com.hhl.menu.*;
import com.hhl.util.HttpRequestUtil;
import com.hhl.util.WXURLUtil;
import com.hhl.util.WechatAccessToken;


/**
 * 大坪病案打印
 * 说明：<br>
 * <h1>创 建 人: hehailong   <br></h1>
 * 创建日期: 2017-11-13 下午4:43:51<br>
 * 需要的jar包:
 */
public class menutest5 {

	public static void main(String[] args) {

		ViewButton webSetApp2 = new ViewButton();
		webSetApp2.setName("全程管理");
		webSetApp2.setType("view");
		webSetApp2.setUrl("https://mp.weixin.qq.com/s/XZy9GFVJF1Ka35_K42xhXg");



		ViewButton vb1_1 = new ViewButton();
		vb1_1.setName("2型糖尿病管理");
		vb1_1.setType("view");
		vb1_1.setUrl("https://mp.weixin.qq.com/s/oZg4UqmwRxufYWfNQh8lyw");

		ViewButton vb1_2 = new ViewButton();
		vb1_2.setName("2型糖尿病逆转缓解");
		vb1_2.setType("view");
		vb1_2.setUrl("https://mp.weixin.qq.com/s/sdX1MzjS0igUsysR51MhrQ");

		ViewButton vb1_3 = new ViewButton();
		vb1_3.setName("医学营养体重管理");
		vb1_3.setType("view");
		vb1_3.setUrl("https://mp.weixin.qq.com/s/t3n_ghEm2B1yzNeXrPLGAw");

		ViewButton vb1_4 = new ViewButton();
		vb1_4.setName("妊娠期糖尿病管理");
		vb1_4.setType("view");
		vb1_4.setUrl("https://mp.weixin.qq.com/s/LrAP0ZQCWj7ZiQjVJf95oA");

		ComlexButton menu1 = new ComlexButton();
		menu1.setName("个性治疗");
		menu1.setSub_button(new BaseButton[]{vb1_1,vb1_2,vb1_3,vb1_4});

		ViewButton aa1 = new ViewButton();
		aa1.setName("客服咨询");
		aa1.setType("view");
		aa1.setUrl("https://mp.weixin.qq.com/s/nFMu-t1kVIC7JjhL_cesFA");

		Menu menu = new Menu();
		menu.setButton(new BaseButton[]{webSetApp2,menu1,aa1});
		
		String btnJson = JSONObject.toJSONString(menu);
		
		System.out.println(btnJson);
		
		
//		String token = WechatAccessToken.getAccessToken("wx289adfd6df38b03d", "ff1f9a6468e49743affaebd5437405f2").getToken();
		String token = "63_CvNp1m98tEOR23GkrKORsyOuoG_5BJdDvtUy6OyghLHcH1MFMbXYMVAGyXNuuANOTRlT-KkfvWWSatIW2rhBQ48ZbCHIQSb220TC6lSlxS5JYUx3uQ-IZNa6SNsROChAHABYM";
		System.out.println(JSONObject.toJSONString(menu));
		
		
//		JSONObject bbb = HttpRequestUtil.httpRequest(WXURLUtil.MENU_URL.replace("ACCESS_TOKEN", token), "POST", JSONObject.toJSONString(menu));
//		System.out.println(JSONObject.toJSONString(bbb));
		
	}
	
}
